package no.mehdi.usereg.web.form;

import no.mehdi.usereg.core.service.PersonService;
import no.mehdi.usereg.rfid.events.TagGainEventApp;

import org.springframework.context.ApplicationListener;

import com.phidgets.RFIDPhidget;

public class RfidListener implements ApplicationListener<TagGainEventApp>{
	
	private RfidForm rfidForm;
	private PersonService personService;
	
	public RfidForm getRfidForm() {
		return rfidForm;
	}


	public void setRfidForm(RfidForm rfidForm) {
		this.rfidForm = rfidForm;
	}


	@Override
	public void onApplicationEvent(TagGainEventApp appEvent) {
			RFIDPhidget rfid = (RFIDPhidget) appEvent.getSource();
			//TODO start her
			
			rfidForm.setUuid(appEvent.getValue());
			rfidForm.fireListener();
			
	}





}
